<template>
  <el-text type="primary" @click="handleClick">
    <slot />
  </el-text>
</template>

<script setup>
const props = defineProps({
  to: {
    type: String,
    required: true,
    values: ['logo', 'register'],
  }
})

const toComponent = inject('toComponent')
function handleClick() {
  toComponent(props.to)
}
</script>

<style lang="scss" scoped>
.el-text {
  display: inline-block;
  cursor: pointer;
}
</style>
